package com.qf.service.Impl;

import com.qf.mapper.JiudianMapper;
import com.qf.pojo.Jiudian;
import com.qf.service.JiudianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JiudianServiceImpl implements JiudianService {
    @Autowired
    private JiudianMapper jiudianMapper;

    @Override
    public List<Jiudian> findAll() {
        List<Jiudian> all = jiudianMapper.findAll();
        return all;
    }

    @Override
    public Jiudian selectJiudianById(Integer id) {
        Jiudian jiudian = jiudianMapper.selectByPrimaryKey(id);
        return jiudian;
    }

    @Override
    public List<Jiudian> selectJiudianByJname(String jname) {
        List<Jiudian> jiudians = jiudianMapper.selectJiudianByJname(jname);
        return jiudians;
    }

    @Override
    public void deleteJiudianByJid(Integer jid) {
        jiudianMapper.deleteByPrimaryKey(jid);
    }

    @Override
    public void addJiudian(Jiudian jiudian) {
        jiudianMapper.insert(jiudian);
    }

    @Override
    public void updateJiudian(Jiudian jiudian) {
        jiudianMapper.updateByPrimaryKey(jiudian);
    }

    @Override
    public List<Jiudian> selectshouyemohu(String jname) {
        List<Jiudian> selectshouyemohu = jiudianMapper.selectshouyemohu(jname);
        return selectshouyemohu;
    }

}
